package com.microsec.iot.servlet;

import java.io.IOException;
import java.util.Timer;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.websocket.server.ServerEndpoint;

@ServerEndpoint("/RegularTasks")
public class RegularTasks extends HttpServlet {
 
	private static final long serialVersionUID = 2352042294308951057L;
	
	private Timer timer = null;
 
    public void init(ServletConfig config) throws ServletException {
        super.init(config);
        timer = new Timer(true);
        // 每一小时进行一次
        timer.schedule(new MyTask(), 0, 60*60*1000);               
    }
 
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    }
 
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    }
 
    public void destroy() {
    }
}
